<template>
  <div>{{ $store.state.count }}</div>
  <button @click="add">+1</button>
  <button @click="decrement">-1</button>
  <button @click="addTwo">+2</button>
  <home/>
</template>

<script>
import Home from './pages/home.vue'
export default {
  // setup () {
  //   const add = () => {}
  //   const decrement = () => {}
  //   return {
  //     add,
  //     decrement
  //   }
  // }
  components: {
    Home
  },
  methods: {
    add () {
      this.$store.commit('add', 1)
    },
    decrement () {
      this.$store.commit('decrement', 1)
    },
    addTwo () {
      this.$store.dispatch('addTWO', 2)
    }
  }
}
</script>

<style scoped>
</style>
